<fieldset>
    <legend>条件搜索</legend>
    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">学校名称</label>
            <div class="layui-input-inline">
                <input name="school_name" value="{$Think.get.school_name|default=''}" placeholder="请输入学校名称" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
            <button type="button" class="layui-btn layui-btn-primary" id="import"><i class="layui-icon"></i>导入学号EXCEL</button>&nbsp;
            <button type="button" data-import-list class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-export"></i>下载导入模板</button>
        </div>
    </form>
</fieldset>
<script>
    window.form.render();
    $('[data-import-list]').on('click', function () {
        window.location.href = '{:url("import_template",false,false)}?' + $(this).parents('form').serialize()
    });
</script>

<script>
    layui.use('upload', function () {
        var upload = layui.upload;

        upload.render({
            elem: '#import'
            , url: '{:url("import",false,false)}'
            , accept: 'file'
            , size: 60000 //限制文件大小，单位 KB
            , done: function (res) {
                if(res.code==1){
                    layer.alert('导入成功，请刷新页面！')
                }else if(res.code==0){
                    layer.alert('导入失败，格式有误！')
                }

            }
        });
    });

</script>